package com.cyurs.netty.dubborpc.consumer;

import com.cyurs.netty.dubborpc.netty.NettyClient;
import com.cyurs.netty.dubborpc.publicInterface.HelloService;

/**
 * @Author: Cyrus
 * @CreateDate: 2020/11/30
 */
public class ClientBootStrap {
    public static final String providerName = "Hello#Cyrus#";

    public static void main(String[] args) throws InterruptedException {
        //创建一个消费者
        NettyClient customer = new NettyClient();
        //创建代理对象
        HelloService service = (HelloService) customer.getBean(HelloService.class, providerName);
        //通过代理对象调用服务提供者的方法（服务API）
        for (; ; ) {
            Thread.sleep(5 * 1000);
            String result = service.hello("你好 dubbo...");
            System.out.println("调用的结果 result="+result);
        }
    }
}
